package com.wisdudu.blank.ui.common;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;

import com.wisdudu.blank.support.rxbus.RxBusFlag;
import com.wisdudu.frame.base.BaseFragment;
import com.wisdudu.frame.base.BaseFragmentActivity;

/**
 * Created by qyf on 2016/7/12.
 */
public class SelectYMDActivity extends BaseFragmentActivity {

    public static final int REQUEST_SELECT_BIRTHDAY = 100;
    private String ymdStr;
    private int flag;//1注册选择生日 2修改资料提交生日选择

    @Override
    protected BaseFragment getRootFragment() {
        Bundle bundle = new Bundle();
        if (!TextUtils.isEmpty(ymdStr)) {
            bundle.putString(RxBusFlag.SELECT_YMD, ymdStr);
        }
        bundle.putInt(RxBusFlag.SELECT_YMD_FLAG, flag);
        SelectYMDFragment fragment = new SelectYMDFragment();
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    protected void handleIntent(Intent intent) {
        super.handleIntent(intent);
        flag = intent.getIntExtra(RxBusFlag.SELECT_YMD_FLAG, 0);
        ymdStr = intent.getStringExtra(RxBusFlag.SELECT_YMD);
    }
}
